<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="../css/element.css" rel="stylesheet"/>
    <link href="../css/styleindex.css" rel="stylesheet"/>
    <style>

    </style>
</head>
<body style="background:#EFF0F4;">

  <div class="mui-content">
    <div id="vm" class="x-examok" v-cloak>
      <div class="x-header-g" id="header">
        <a class="x-header-arrow" @click="api.closeWin()"></a>
        <div class="x-header-t">打烊安全检查</div>
      </div>
      <template>
        <el-table :data="tabledata">
          <el-table-column label="序号" width="50" type="index" fixed></el-table-column>
          <el-table-column label="检查项目" width="" fixed>
            <template slot-scope="scope">
              {{scope.row.title}}
            </template>
          </el-table-column>
          <el-table-column label="检查结果" width="120">
            <template slot-scope="scope">
              <div v-if="scope.row.is_ok==''" size="mini" class="x-text-g">未确认</div>
              <div v-if="scope.row.is_ok=='1'" size="mini" class="x-text-g">已完成</div>
              <div v-if="scope.row.is_ok=='2'" size="mini" class="x-text-r">未完成</div>
            </template>
          </el-table-column>
          <el-table-column label="记录要点" width="">
            <template slot-scope="scope">
              <div v-if="scope.row.content==''&&scope.row.img==''">无</div>
              <el-button type="text" size="mini" @click="editfavo(scope.row.id,scope.row.content,scope.row.img)" v-else>查看</el-button>
            </template>
          </el-table-column>
          <el-table-column label="检查人" width="">
            <template slot-scope="scope">
              {{scope.row.username}}
            </template>
          </el-table-column>
        </el-table>
      </template>
      <!--  -->
      <el-dialog title="" :visible.sync="edittoast" width="90%" center="true" close-on-click-modal="false" show-close="false">
        <div class="x-pro-row">
          <div class="x-pro-label">文字内容：</div>
          <div class="x-pro-input">
            <el-input placeholder="请输入" v-model="textvalue" type="textarea" :rows="3" disabled="true"></el-input>
          </div>
        </div>
        <div class="x-pro-row">
          <div class="x-pro-label">图片内容：</div>
          <div class="x-pro-input">
            <!-- <el-button type="success" @click="imgPer">添加图片</el-button> -->
          </div>
        </div>
        <div class="x-pro-himg" :style="{'background-image':'url(' +input4+ ')','background-size':'cover','width':'6rem','height':'6rem','border-radius':'0.4rem','margin-top':'1rem'}" v-if="input4!=''" @click="imagebig = true"></div>
        <!-- <span slot="footer" class="dialog-footer">
          <div class="x-pro-gobtn" @click="okgettime" v-show="!isfromindex">提交</div>
        </span> -->
      </el-dialog>
      <img :src="input4" alt="" width="100%" v-if="imagebig" class="x-img-big" @click="imagebig = false">
    </div>
  </div>

  <script type="text/javascript" src="../script/vue.js"></script>
  <script type="text/javascript" src="../script/element.js"></script>
  <script type="text/javascript" src="../script/api.js"></script>
  <script type="text/javascript" src="../script/base.js"></script>
	<script>
apiready = function () {
    $api.fixStatusBar($api.byId('header'));


    //
    var vm = new Vue({
      el:'#vm',
      data(){
        return{
          tabledata:[],
          edittoast:false,
          textvalue:'',
          input4:'',
          editid:'',
          isfromindex:false,
          cardsmonth:'',
          imagebig:false

        }
      },
      created:function() {
        var that=this;


      },
      mounted:function(){
        var that=this;
        that.getdata()

      },
      methods: {
        getdata:function(){
          let that=this;
          api.ajax({
            url:baseurl+'api/duty/getClosed',
            methods:'get',
            data:{
              values:{
                sec: $api.getStorage('apptoken'),
                date:that.cardsmonth,
                _ssid:$api.getStorage('jobid')
              }
            }
          },function(ret,err){
            if(ret){
              api.hideProgress();
              console.log(JSON.stringify(ret));
              if(ret.status == 1){
                that.tabledata = ret.data.list;

              }else{
                api.toast({
                    msg: ret.msg,
                    duration: 3000,
                    location: 'bottom'
                });
              }
            }else{
              api.hideProgress();
              console.log(JSON.stringify(err));
              api.toast({
                  msg: err.msg,
                  duration: 3000,
                  location: 'bottom'
              });
            }
          })
        },
        //记录要点
        editfavo:function(id,con,img){
          var that = this;
          that.textvalue = con;
          that.input4 = img;
          that.editid = id;
          that.edittoast = true;

        },

      }
    })
	}


	</script>
</body>
</html>
